<template>
  <div>
    <div class="box" v-for="(item, index) in records" :key="index">
      <van-row>
        <van-col span="12">商品描述</van-col>
        <van-col class="app" span="12">></van-col>
      </van-row>
      <div class="app">
        <div class="app-1">
          <img src="../assets/发货单图标/xiangji.png" alt="" />
        </div>
        <div class="app-2">
          <ul>
            <li>{{ item.title }}</li>
            <li>{{ item.orderTime }}</li>
            <li>{{ item.orderUserName }}</li>
          </ul>
        </div>
      </div>
      <van-button round @click="qbadd(item.status, item.serialNo)">{{
        results(item.status)
      }}</van-button>
    </div>
  </div>
</template>

<script>
export default {
  props: ["records"],
  data() {
    return {};
  },
  methods: {
    results(val) {
    //   console.log(val);
      if (val == 0) {
        // console.log("未发货");
        return "发货";
      } else if (val == 10) {
        //  console.log("未收货");
        return "待收货";
      } else if (val == 20) {
        //  console.log("未评价");
        return "评价";
      } else {
        // console.log("已评价");
        return "查看评价";
      }
    },

    //点击进去查看评论
    qbadd(status, serialNo) {
        // console.log(status);
      if (status == 0) {
        // console.log("未发货");
        
        return;
      } else if (status == 10) {
        //  console.log("未收货");
        // this.$router.push(`/consignment?id=2`)
        return;
      } else if (status == 20) {
        //  console.log("未评价");
        // this.$router.push(`/topingfen?serialNo=${serialNo}`)
        return;
      } else {
        // console.log("已评价");
        this.$router.push(`/fahuodanCkpl?serialNo=${serialNo}`);
        return;
      }
    },
  },
};
</script>
 
<style lang = "less" scoped>
.box {
  .van-row {
    padding: 10px;
  }
  .app {
    text-align: right;
  }
  .van-button {
    width: 100px;
    margin-right: 10px;
    height: 40px;
    background-color: yellow;
    margin: 10px 0;
    margin-left: 300px;
  }
}
.app {
  display: flex;
  .app-1 {
    padding: 20px;
  }
  .app-2 {
    line-height: 35px;
    text-align: left;
  }
}
</style>